package com.qolome.knowledge.design.pattern.singleton.hungry;

/**
 * @Description 饿汉式单例
 *优点:执行效率高,性能高,无锁
 * 缺点:费内存
 * @author Qolome
 * @date 2020年 02月28日 11:17:09
 * @version V1.0
 */
public class HungryStaticSingleton {

    private static final HungryStaticSingleton hungrySingleton;

    private HungryStaticSingleton(){};
    static {
        hungrySingleton = new HungryStaticSingleton();
    }
    public static HungryStaticSingleton getInstance(){ return hungrySingleton;}

}